package collect;

import java.util.HashSet;
import java.util.Iterator;

/**
 * HashSet 对象
 * @author galen
 */
public class HashSetClass {
    public static void main(String[] args) {
        HashSet<String> courseSet = new HashSet<String>();
        String course1 = new String("Java入门教程");
        String course2 = new String("Python基础教程");
        String course3 = new String("C语言学习教程");

        courseSet.add(course1);
        courseSet.add(course2);
        courseSet.add(course3);
        System.out.println("C语言中文网教程有：");
        Iterator<String> it = courseSet.iterator();
        while(it.hasNext()) {
            System.out.println("<<" + (String)it.next() + ">>");
        }
        System.out.println("有" + courseSet.size() + "套精彩教程！");

    }
}
